home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / initHelpLine.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.4 KB  |  119 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  Aug 15 1996
  22. //
  23. //  Description:
  24. //      This script initializes the Help line.  Initialization involves
  25. //        determining the initial Help line preferences, creating the UI and
  26. //        setting the initial visibility.
  27. //
  28. {
  29.     //   Declare referenced or returned globals.
  30.     //
  31.     global string $gHelpLineForm;
  32.     global string $gMainProgressBar;
  33.     
  34.     //  Create a layout appropriate for the Help line.
  35.     // 
  36.     string $helpLine = `frameLayout
  37.         -parent $gHelpLineForm 
  38.         -borderVisible  true
  39.         -borderStyle    "in"
  40.         -labelVisible   false
  41.         -collapse       false
  42.         -collapsable    false`;
  43.  
  44.     string $innerForm = `formLayout -parent $helpLine`;
  45.  
  46.     //    Now actually create the Help line.
  47.     //
  48.     string $helpControl = `helpLine 
  49.         -annotation "HelpLine: Displays short help tips for tools and selections"`;
  50.  
  51.     //    Now create the embedded progressbar
  52.     //
  53.     $gMainProgressBar = `progressBar -isMainProgressBar true 
  54.         -visible false 
  55.         -width 1 
  56.         -height 10 
  57.         mainProgressBar`;
  58.  
  59.     formLayout -edit
  60.         -af $helpControl    "top"        0
  61.         -ac $helpControl    "left"        0 $gMainProgressBar
  62.         -af $helpControl    "bottom"    0
  63.         -af $helpControl    "right"        0
  64.  
  65.         -af $gMainProgressBar     "left"        2
  66.         -af $gMainProgressBar    "top"        4
  67.         -af $gMainProgressBar    "bottom"    3
  68.         -an $gMainProgressBar    "right"
  69.  
  70.         $innerForm;
  71.  
  72.     //    Attach Help line to parent.
  73.     //
  74.     formLayout -edit
  75.         -attachForm $helpLine "top"    0
  76.         -attachForm $helpLine "left"   1
  77.         -attachForm $helpLine "bottom" 0
  78.         -attachForm $helpLine "right"  0
  79.         $gHelpLineForm;
  80.  
  81.     setUIComponentStateCallback(
  82.         "Help Line", "helpLineVisibilityStateChange");
  83.  
  84.     //    Set the Help line's initial visibility.
  85.     //
  86.     setHelpLineVisible(`optionVar -query helpLineVisible`);
  87. }
  88.  
  89. global proc int helpLineVisibilityStateChange(
  90.     int    $newState,
  91.     string $layout)
  92. //
  93. //    Description:
  94. //        This procedure is called whenever the visibility state of the 
  95. //        Help Line is changed.
  96. //
  97. //    Arguments:
  98. //        newState - The new visibile state of the Help Line.
  99. //
  100. //        layout - The parent layout for the Help Line.
  101. //
  102. //    Returns:
  103. //        true - If the change of state is to be allowed.
  104. //
  105. //        false - If the state change is rejected.
  106. //
  107. {
  108.     int $result = true;
  109.  
  110.     //    Defer these commands because this proc is called when the visibility
  111.     //    state is about to change. This proc must return true to accept 
  112.     //    the state change. After this proc returns then restore the
  113.     //    panel focus and update the pref menu.
  114.     //
  115.     evalDeferred("restoreLastPanelWithFocus(); updatePrefsMenu();");
  116.  
  117.     return $result;
  118. }
  119.